package com.temp.enumeration;

public enum VerifyResult {
    UNVERIFIED(0, "未验证"),
    SUCCESS(1, "验证成功"),
    FAILED(2, "验证失败");

    private final int code;
    private final String desc;

    VerifyResult(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static VerifyResult fromCode(int code) {
        for (VerifyResult result : VerifyResult.values()) {
            if (result.getCode() == code) {
                return result;
            }
        }
        return null;
    }
}